package priv.stones.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;

import java.io.Serializable;
import java.util.Date;

/**
 * @Author: Stones
 * @Description:
 * @Date: 2017-10-11
 */
@TableName("sys_admin")
public class SysAdmin extends Model<SysAdmin> {

    private static final long serialVersionUID = 1L;

    private String id;
    private String headimg;
    private String name;
    private String loginpwd;
    private String loginsalt;
    /**
     * 1：正常 2：不允许登陆
     */
    private Integer status;
    @TableField(exist = false)
    private String statusText;

    private String phone;
    private String mail;
    private String remark;
    private Date registetime;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getHeadimg() {
        return headimg;
    }

    public void setHeadimg(String headimg) {
        this.headimg = headimg;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLoginpwd() {
        return loginpwd;
    }

    public void setLoginpwd(String loginpwd) {
        this.loginpwd = loginpwd;
    }

    public String getLoginsalt() {
        return loginsalt;
    }

    public void setLoginsalt(String loginsalt) {
        this.loginsalt = loginsalt;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getMail() {
        return mail;
    }

    public void setMail(String mail) {
        this.mail = mail;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Date getRegistetime() {
        return registetime;
    }

    public void setRegistetime(Date registetime) {
        this.registetime = registetime;
    }

    public String getStatusText() {
        switch (status) {
            case 1:
                return "正常";
            case 2:
                return "不允许登陆";
            default:
                return "未知";
        }
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
